name: building project

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  # Джоб проверки проекта
  checks:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [ 20.x ]
    steps:
      - uses: actions/checkout@v2
      - name: Staring Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: install deps
        run: npm i
      - name: build project
        run: npm run build:prod
      - name: up storybook
        run: npm run storybook:build
        if: always()
      - name: lint stylelint
        run: npm run lint:stylelint:fix
        if: always()
      - name: lint eslint
        run: npm run lint:eslint:fix
        if: always()
      - name: unit tests
        run: npm run test:unit
        if: always()
      - name: unit ui
        run: npm run test:ui:ci
        if: always()
  # джоб сборки проекта
#  build:
#    runs-on: ubuntu-latest
#    strategy:
#      matrix:
#        node-version: [ 20.x ]
#    steps:
#      - uses: actions/checkout@main
#      - name: Publish to Registry
#        uses: elgohr/Publish-Docker-Github-Action@v5
#        with:
#          registry: docker.pkg.github.com
#          name: docker.pkg.github.com/zeizel/production-frontend/production-frontend
#          username: ${{ secrets.DOCKER_USERNAME }}
#          password: ${{ secrets.DOCKER_PASSWORD }}
#          tags: "develop"